﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage/List.Master" AutoEventWireup="true" CodeBehind="ProjectSplit.aspx.cs" Inherits="Honestysoft.Financing.WebUI.Module.Project.ProjectSplit" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script language="javascript" type="text/javascript">
        function deleteSplit(id) {
            document.getElementById("<%=hidDeleteID.ClientID %>").value = id;
            document.getElementById("<%=btnDeleteSplit.ClientID %>").click();
        }
        function addSplit(id) {
            return openDialog('<%=Honestysoft.Baseframework.WebUI.Globals.Home %>Module/Project/SelectSplitProject.aspx?ID='+id+'&FunctionID=<%=FunctionID %>',<%=ModalDialogSize.EditWidth %>,<%=ModalDialogSize.EditHeight  %>, '新增拆分项目设置');
        }
        function setName(id,text){
            $.ajax({
                        type: "POST",
                        url: "JSON/SetProjectSplit.ashx?ID=" + id + "&Name=" + escape(text) +"&randId=" + escape(new Date()),
                        data: "",
                        success: function (msg) {
                            alert("修改拆分项目包名称成功！");
                        },
                        error:function(){
                            alert("修改拆分项目包名称失败！");
                        }
                    });
        }
    </script>
    <style type="text/css">
    a
    {
        color:Blue;
    }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div class="query_area" style="text-align:right">
         <asp:Button runat="server" ID="btnAdd" CssClass="btn_normal" 
			onMouseOver="this.className='btn_active'" 
            onMouseOut="this.className='btn_normal'" Text="新 增"/>
        <asp:Button runat="server" ID="btnDelete" CssClass="btn_normal" 
			onMouseOver="this.className='btn_active'" 
            onMouseOut="this.className='btn_normal'" Text="删 除" 
            
             OnClientClick="javascript:return getNoSelectionAlert('chkID','请选择要删除的记录后在执行此操作！');" onclick="btnDelete_Click"             
             />
    </div>
    <asp:Button runat="server" ID="btnDeleteSplit"  style="display:none"  onclick="btnDeleteSplit_Click"/>
    <asp:DataList ID="dlSplit" runat="server" RepeatColumns="3"
        RepeatDirection="Horizontal"  Width="100%" 
        onitemdatabound="dlSplit_ItemDataBound" ItemStyle-VerticalAlign="Top">
        <ItemTemplate>
            <table width="100%" height="125px" style="border: 1px solid #99CCFF; background-color: #E7E7E7;">
                <tr>
                    <td style="padding:8px;font-size:9pt;font-family:宋体;vertical-align:top;">
                        <table  width="100%">
                        <tr>
                            <td>
                            <input type="checkbox" name="chkID" id="chk<%# DataBinder.Eval(Container.DataItem,"ID") %>"  value="<%# DataBinder.Eval(Container.DataItem,"ID") %>" >
                            </td>
                            <td>
                            <input type="text" style="width:94%" id="txtName" onchange="javascript:setName('<%# DataBinder.Eval(Container.DataItem,"ID") %>',this.value);" value='<%# DataBinder.Eval(Container.DataItem,"Name") %>' />
                            </td><td><a href="#" onclick="javascript:addSplit('<%# DataBinder.Eval(Container.DataItem,"ID")+"" %>');">新增</a></td>
                        </tr>
                    <asp:Repeater runat="server" ID="rptProject">
                        <ItemTemplate>
                            <tr><td width="40px"><%# DataBinder.Eval(Container.DataItem,"SN") %>&nbsp;</td>
                            <td>
                                <%# GetProjectUrl( DataBinder.Eval(Container.DataItem,"ProjectID")+"", DataBinder.Eval(Container.DataItem,"Name")+"") %>
                            </td>
                            <td width="30px"><a href="#" onclick="javascript:deleteSplit('<%# DataBinder.Eval(Container.DataItem,"ID")+"" %>');">删除</a></td>
                            </tr>
                        </ItemTemplate>
                    </asp:Repeater>
                        </table>
                    </td>
                </tr>
            </table>
        </ItemTemplate>
    </asp:DataList>
    <asp:HiddenField runat="server" ID="hidDeleteID" />
</asp:Content>
